import request from '@/utils/request'

// 查询钉钉配置列表
export function listDingTalk(query) {
  return request({
    url: '/business/dingTalk/list',
    method: 'get',
    params: query
  })
}

// 查询钉钉配置详细
export function getDingTalk(id) {
  return request({
    url: '/business/dingTalk/' + id,
    method: 'get'
  })
}

// 新增钉钉配置
export function addDingTalk(data) {
  return request({
    url: '/business/dingTalk',
    method: 'post',
    data: data
  })
}

// 修改钉钉配置
export function updateDingTalk(data) {
  return request({
    url: '/business/dingTalk',
    method: 'put',
    data: data
  })
}

// 删除钉钉配置
export function delDingTalk(id) {
  return request({
    url: '/business/dingTalk/' + id,
    method: 'delete'
  })
}

// 导出文件
export function exportExcel(data){
  return request({
    url: '/business/dingTalk/export',
    method: 'post',
    data: data
  })
}

// 刷新缓存
export function refreshCache() {
  return request({
    url: '/business/dingTalk/refreshCache',
    method: 'delete'
  })
}
